package hu.debrecen.adastra.card.repository;

import hu.debrecen.adastra.card.repository.domain.Achievement;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

public interface AchievementRepository extends CrudRepository<Achievement, Long> {

	@Query("select a from Achievement a where a.account.username = ? and a.showed = FALSE")
	List<Achievement> findNewAchievementsByUsername(String username);

	@Query("select a.achievementId from Achievement a where a.account.username = ?")
	List<String> getAchivedAchievementsByAccount(String username);

}
